#include "Bus.h"
#include "GameManager.h"
#include "CEMoveBySpeed.h"

float Bus::width = 2.5*METTER_TO_POINT;
float Bus::length = 10*METTER_TO_POINT;

Bus::Bus()
{
	setTag(ID_BUS);
}

Bus::~Bus()
{
}

bool Bus::init(){
	Vehicle::init();
    
    width = 2.5*METTER_TO_POINT;
    length = 10*METTER_TO_POINT;

	mainSprite = CCSprite::createWithSpriteFrameName("Bus.png");
	mainSprite->setAnchorPoint(ccp(0, 0));
	addChild(mainSprite);

	float realSizeX = length;
	float scaleFactorX = realSizeX/mainSprite->boundingBox().size.width;
	mainSprite->setScaleX(scaleFactorX);

	float realSizeY = width;
	float scaleFactorY = realSizeY/mainSprite->boundingBox().size.height;
	mainSprite->setScaleY(scaleFactorY);

	setContentSize(mainSprite->boundingBox().size);

	return true;
}